package com.bwie.controller;

import com.bwie.pojo.User;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author : LeiMingkun
 * @date : 2024-09-09 09:08
 * @description : UserController
 **/
@RestController
@RequestMapping("/user/user")
public class UserController {
    @Resource
    private UserService userService;
    @RequestMapping("/getLogin")
    public R getLogin(@RequestBody User user){
        return userService.getLogin(user);
    }
    @RequestMapping("/sendCode")
    public R sendCode(@RequestBody User user){
        return userService.sendCode(user);
    }
    @RequestMapping("/findUser")
    public R findUser(@RequestBody User user){
        return userService.findUser(user);
    }

    @RequestMapping("/getList")
    public R getList(){
        return R.success(userService.list());
    }

}